package chd.edu.spzx.common.exception;

import chd.edu.spzx.model.vo.common.ResultCodeEnum;
import lombok.Data;

/**
 * @author Zhang Chaoliang
 * create 2023
 */
@Data
public class GuiguException extends RuntimeException{

    //错误状态码
    private Integer code;

    //错误消息
    private String message;

    //封装错误状态
    private ResultCodeEnum resultCodeEnum;

    public GuiguException(ResultCodeEnum resultCodeEnum){
        this.resultCodeEnum = resultCodeEnum;
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }
}
